package com.zhouwr.common.metadata;

import com.alibaba.fastjson.JSON;
import com.zhouwr.common.enums.ModelDataType;
import com.zhouwr.common.utils.Vector3;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @program: forallcn-iotps
 * @description: 三维坐标
 * @author: zhouwr
 * @create: 2020-11-24 16:20
 * @version：1.0
 **/

@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class Vector3Data extends Metadata<String> {
    private Vector3 defaultValue = new Vector3(0, 0, 0);
    private ModelDataType type = ModelDataType.VECTOR3DATA;


    @Override
    public String getDefaultValue() {
        return null;
    }

    public static Vector3Data form(String metadata){
        return JSON.toJavaObject(JSON.parseObject(metadata), Vector3Data.class);
    }
}
